# (C) Datadog, Inc. 2022-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os

from datadog_checks.dev import get_docker_hostname

HOST = get_docker_hostname()
PORT = '8529'

ARANGODB_VERSION = os.getenv('ARANGODB_VERSION')

METRICS = [
    'arangodb.agency.cache.callback',
    'arangodb.agency.callback',
    'arangodb.agency.callback.registered.count',
    'arangodb.agency.request.time.sum',
    'arangodb.agency.request.time.count',
    'arangodb.agency.request.time.bucket',
    'arangodb.network.forwarded.requests.count',
    'arangodb.network.request.timeouts.count',
    'arangodb.network.requests.in.flight',
    'arangodb.aql.all.query.count',
    'arangodb.aql.current.query',
    'arangodb.aql.global.memory.limit',
    'arangodb.aql.global.memory.usage',
    'arangodb.aql.global.query.memory.limit.reached.count',
    'arangodb.aql.local.query.memory.limit.reached.count',
    'arangodb.aql.query.time.bucket',
    'arangodb.aql.query.time.count',
    'arangodb.aql.query.time.sum',
    'arangodb.aql.slow.query.time.bucket',
    'arangodb.aql.slow.query.time.count',
    'arangodb.aql.slow.query.time.sum',
    'arangodb.client.connection.bytes.received.bucket',
    'arangodb.client.connection.bytes.received.count',
    'arangodb.client.connection.bytes.received.sum',
    'arangodb.client.connections',
    'arangodb.client.connection.time.bucket',
    'arangodb.client.connection.time.count',
    'arangodb.client.connection.time.sum',
    'arangodb.client.connection.io.time.bucket',
    'arangodb.client.connection.io.time.count',
    'arangodb.client.connection.io.time.sum',
    'arangodb.client.connection.queue.time.bucket',
    'arangodb.client.connection.queue.time.count',
    'arangodb.client.connection.queue.time.sum',
    'arangodb.client.connection.request.time.bucket',
    'arangodb.client.connection.request.time.count',
    'arangodb.client.connection.request.time.sum',
    'arangodb.client.connection.total.time.bucket',
    'arangodb.client.connection.total.time.count',
    'arangodb.client.connection.total.time.sum',
    'arangodb.http.async.requests.count',
    'arangodb.http.delete.requests.count',
    'arangodb.http.get.requests.count',
    'arangodb.http.head.requests.count',
    'arangodb.http.options.requests.count',
    'arangodb.http.patch.requests.count',
    'arangodb.http.post.requests.count',
    'arangodb.http.put.requests.count',
    'arangodb.http.other.requests.count',
    'arangodb.http.total.requests.count',
    'arangodb.http.user.requests.count',
    'arangodb.process.page.faults.major.count',
    'arangodb.process.page.faults.minor.count',
    'arangodb.process.threads',
    'arangodb.process.resident_set_size',
    'arangodb.process.system_time',
    'arangodb.process.user_time',
    'arangodb.process.virtual_memory_size',
    'arangodb.server.cpu_cores',
    'arangodb.server.idle_percent',
    'arangodb.server.iowait_percent',
    'arangodb.server.physical_memory',
    'arangodb.server.kernel_mode.percent',
    'arangodb.server.user_mode.percent',
    'arangodb.collection.lock.acquisition.count',
    'arangodb.collection.lock.sequential_mode.count',
    'arangodb.collection.lock.timeouts_exclusive.count',
    'arangodb.collection.lock.timeouts_write.count',
    'arangodb.transactions.read.count',
    'arangodb.transactions.aborted.count',
    'arangodb.transactions.committed.count',
    'arangodb.transactions.expired.count',
    'arangodb.transactions.started.count',
    'arangodb.rocksdb.collection_lock.acquisition_time.bucket',
    'arangodb.rocksdb.collection_lock.acquisition_time.count',
    'arangodb.rocksdb.collection_lock.acquisition_time.sum',
    'arangodb.rocksdb.write.stalls.count',
    'arangodb.rocksdb.write.stops.count',
    'arangodb.rocksdb.actual.delayed.write.rate',
    'arangodb.rocksdb.archived.wal.files',
    'arangodb.rocksdb.background.errors',
    'arangodb.rocksdb.base.level',
    'arangodb.rocksdb.block.cache.capacity',
    'arangodb.rocksdb.block.cache.pinned.usage',
    'arangodb.rocksdb.block.cache.usage',
    'arangodb.rocksdb.cache.hit.rate.lifetime',
    'arangodb.rocksdb.cache.limit',
    'arangodb.rocksdb.compaction.pending',
    'arangodb.rocksdb.cur.size.active.mem.table',
    'arangodb.rocksdb.cur.size.all.mem.tables',
    'arangodb.rocksdb.engine.throttle.bps',
    'arangodb.rocksdb.estimate.live.data.size',
    'arangodb.rocksdb.estimate.num.keys',
    'arangodb.rocksdb.estimate.pending.compaction.bytes',
    'arangodb.rocksdb.estimate.table.readers.mem',
    'arangodb.rocksdb.free.disk.space',
    'arangodb.rocksdb.free.inodes',
    'arangodb.rocksdb.live.sst.files.size',
    'arangodb.rocksdb.mem.table.flush.pending',
    'arangodb.rocksdb.min.log.number.to.keep',
    'arangodb.rocksdb.num.deletes.active.mem.table',
    'arangodb.rocksdb.num.deletes.imm.mem.tables',
    'arangodb.rocksdb.num.entries.active.mem.table',
    'arangodb.rocksdb.num.entries.imm_mem.tables',
    'arangodb.rocksdb.num.immutable.mem.table',
    'arangodb.rocksdb.num.immutable.mem.table.flushed',
    'arangodb.rocksdb.num.live.versions',
    'arangodb.rocksdb.num.running.compactions',
    'arangodb.rocksdb.num.running.flushes',
    'arangodb.rocksdb.num.snapshots',
    'arangodb.rocksdb.prunable.wal.files',
    'arangodb.rocksdb.size.all.mem.tables',
    'arangodb.rocksdb.total.disk.space',
    'arangodb.health.heartbeat_failures.count',
    'arangodb.health.heartbeat.sent.time.bucket',
    'arangodb.health.heartbeat.sent.time.count',
    'arangodb.health.heartbeat.sent.time.sum',
    'arangodb.connection_pool.connections.created.count',
    'arangodb.connection_pool.connections.current',
    'arangodb.connection_pool.lease_time.bucket',
    'arangodb.connection_pool.lease_time.count',
    'arangodb.connection_pool.lease_time.sum',
    'arangodb.connection_pool.leases.failed.count',
    'arangodb.connection_pool.leases.successful.count',
    'arangodb.http2.connections.count',
    'arangodb.vst.connections.count',
]

OPTIONAL_METRICS = [
    'arangodb.agency.client.lookup.table_size',
    'arangodb.agency.commit.count',
    'arangodb.agency.commit.sum',
    'arangodb.agency.commit.bucket',
    'arangodb.agency.compaction.count',
    'arangodb.agency.compaction.sum',
    'arangodb.agency.compaction.bucket',
    'arangodb.agency.log.size',
    'arangodb.agency.read.no_leader.count',
    'arangodb.agency.read.ok.count',
    'arangodb.agency.supervision.failed.server.count',
    'arangodb.agency.supervision.runtime',
    'arangodb.agency.supervision.runtime.wait.for.replication',
    'arangodb.agency.write.bucket',
    'arangodb.agency.write.count',
    'arangodb.agency.write.sum',
    'arangodb.agency.write.no_leader.count',
    'arangodb.agency.write.ok.count',
    'arangodb.health.dropped_followers.count',
]
